#include "common.h"


float & point::operator [] (int index){
	switch (index){
		case 0:
			return x;
		case 1:
			return y;
		case 2:
			return z;
		default:
			debug("Wrong index called\n");
	}		
}

point point::operator + (point second){
	point a;
	a.x=x+second.x;
	a.y=y+second.y;
	a.z=z+second.z;
	return a;
}

point point::operator - (point second){
	point a;
	a.x=x-second.x;
	a.y=y-second.y;
	a.z=z-second.z;
	return a;
}

point point::operator * (float second){
	point a;
	a.x=x*second;
	a.y=y*second;
	a.z=z*second;
	return a;
}

point point::operator / (float second){
	point a;
	a.x=x/second;
	a.y=y/second;
	a.z=z/second;
	return a;
}

float & UVCord::operator [] (int index){
	switch (index){
		case 0:
			return u;
		case 1:
			return v;
		default:
			debug("Wrong index called\n");
	}		
}

int & face::operator [] (int index){
	switch (index){
		case 0:
			return a;
		case 1:
			return b;
		case 2:
			return c;
		case 3:
			return UV_a;
		case 4:
			return UV_b;
		case 5:
			return UV_c;
		default:
		debug("Wrong index called\n");
	}
}
